package com.system.controller.admin;

import com.common.annotation.LogInfo;
import com.common.util.Excel.ExcelUtil;
import com.system.Excel.ApicodeExcel;
import com.system.service.ApicodeService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletResponse;

@RestController
@RequestMapping("/admin/apicode")
@Api(value = "后台接口编号表会员控制层", tags = {"后台接口编号表会员控制层"})
@LogInfo
public class ApicodeExController {

    @Autowired
    private ApicodeService apicodeService;



    @ApiOperation("接口导出")
    @PostMapping("/export")
    @PreAuthorize("hasAnyAuthority(@servletUtils.getUrl)")
    public void export(HttpServletResponse response) {
        ExcelUtil.export(response, "接口数据", "接口数据表", apicodeService.ExportList(), ApicodeExcel.class);
    }


}
